import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

Vue.config.productionTip = false;

import axios from "axios";

axios.defaults.baseURL = "http://175.27.228.178:3434/api/private/v1/";
//给axios加上一个基本路径之后每次会自动拼接上这个基本路径

axios.interceptors.request.use((config) => {
  config.headers.Authorization = localStorage.getItem("token");
  // 一定要return config
  return config;
});
//这是一个请求拦截  每次发送请求都会被拦下来 拦下来 携带一个token 告诉后台是谁在发送请求

Vue.prototype.$axios = axios;
//全局引入axios

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);
// 全局引入element-ui

import VueQuillEditor from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
Vue.use(VueQuillEditor);
//引入的富文本编辑器

import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
//全局引入echarts

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
